const state = {
  pics: [],
  picPage: {},
  themeList: [],
  themePage: {}
}

const actions = {
  savePicList: ({ commit }, payload) => {
    commit('SAVEPIC', payload)
  },
  saveThemeList: ({ commit }, payload) => {
    commit('SAVETHEME', payload)
  }
}

const mutations = {
  SAVEPIC: (state, payload) => {
    state.pics = payload.result
    state.picPage = {
      number: payload.number || 1,
      total: payload.resultNum,
      size: 10
    }
  },
  SAVETHEME: (state, payload) => {
    state.themeList = payload.result
    state.themePage = {
      number: payload.number || 1,
      total: payload.resultNum,
      size: 10
    }
  }
}

export default {
  state,
  actions,
  mutations
}